//
//  HScrollCollectionViewCell.m
//  MY_IGList_demo
//
//  Created by mac on 2019/3/21.
//  Copyright © 2019 Yilian. All rights reserved.
//

#import "HScrollCollectionViewCell.h"

@implementation HScrollCollectionViewCell
- (UICollectionView *)collectionView {
    if (!_collectionView) {
        UICollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new];
        layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
//        layout.scrollDirection = UICollectionViewScrollDirectionVertical;
        _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
//        _collectionView.pagingEnabled = YES;
        _collectionView.backgroundColor = [UIColor whiteColor];
        _collectionView.alwaysBounceVertical = YES;
        _collectionView.alwaysBounceHorizontal = NO;
        
        [self addSubview:_collectionView];
    }
    return _collectionView;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _collectionView.frame = self.contentView.frame;
}
@end
